Lesson 2 Home

Attributes and Links

Attributes

Attributes provide additional information about the contents of an element. They appear on the opening tag of the element and are made up of two parts: a name and a value, separated by an equals sign. Attributes are also used to modify elements, and are useful when adding links, images, supporting accessibility (for example, alt tags), adding style with CSS and interactions with Javascript. Today, we are going to use them to create links.

<p lang="en">Paragraph in English</p >

In the example above, "lang" is the name and "en" is the value

Summary

Links

Links are the defining feature of the web because they allow you to move from one web page to another — enabling the very idea of browsing or surfing. You will commonly come across the following types of links:

Links are created by using the anchor element. They also need to include a hypertext reference (directions where to go). To include a reference of our links, we need to use the "href" attribute. Let's check out a couple of link examples. In the first example, we'll demonstrate linking to another web page. link example 1

Activity 1